package com.woniu.customer.controller;

import com.woniu.common.entity.Result;
import com.woniu.customer.service.FtpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;

@RestController
public class FtpController {
    @Autowired
    FtpService ftpService;

    @PostMapping("/upload")
    public Result<String> uploadFile(@RequestParam("file") MultipartFile file) throws IOException {
        ftpService.uploadFile(file);

        return Result.ok("上传成功");
    }
}
